// ==========================================================================
// GFast自动生成controller操作代码。
// 生成日期：2024-04-24 10:28:09
// 生成路径: internal/app/business/controller/user_agents.go
// 生成人：周志雄
// desc:代理商用户
// company:云南奇讯科技有限公司
// ==========================================================================

package controller

import (
	"context"
	"github.com/tiger1103/gfast/v3/api/v1/business"
	"github.com/tiger1103/gfast/v3/internal/app/business/service"
	systemController "github.com/tiger1103/gfast/v3/internal/app/system/controller"
)

type userAgentsController struct {
	systemController.BaseController
}

var UserAgents = new(userAgentsController)

// List 列表
func (c *userAgentsController) List(ctx context.Context, req *business.UserAgentsSearchReq) (res *business.UserAgentsSearchRes, err error) {
	res, err = service.UserAgents().List(ctx, req)
	return
}

// Get 获取代理商用户
func (c *userAgentsController) Get(ctx context.Context, req *business.UserAgentsGetReq) (res *business.UserAgentsGetRes, err error) {
	res = new(business.UserAgentsGetRes)
	res.UserAgentsInfoResVo, err = service.UserAgents().GetById(ctx, req.Id)
	return
}

// Add 添加代理商用户
func (c *userAgentsController) Add(ctx context.Context, req *business.UserAgentsAddReq) (res *business.UserAgentsAddRes, err error) {
	err = service.UserAgents().Add(ctx, req)
	return
}

// Edit 修改代理商用户
func (c *userAgentsController) Edit(ctx context.Context, req *business.UserAgentsEditReq) (res *business.UserAgentsEditRes, err error) {
	err = service.UserAgents().Edit(ctx, req)
	return
}

// Delete 删除代理商用户
func (c *userAgentsController) Delete(ctx context.Context, req *business.UserAgentsDeleteReq) (res *business.UserAgentsDeleteRes, err error) {
	err = service.UserAgents().Delete(ctx, req.Ids)
	return
}
